#ifndef _MYDBOP_H_
#define _MYDBOP_H_
#include "easyado.h"
#include "dataarray.h"
#include "commonstruct.h"
class CMyDBOp
{
private:
	CAdoDatabase *m_pDB;
public:
	CMyDBOp();
	virtual ~CMyDBOp();
public:
	bool OpenDB(char *pUser,char *pPassword,char *pDBName,char *pSvrIP,int nPort);
	bool CloseDB();

	bool WriteWebSite(PWEBSITEEX2 pWebSite,char *pTag);

	bool ReadSysCfg(PSYSCFG pSysCfg);
	bool ReadSysInfo(PSYSINFO pSysInfo);

	bool WriteRestore(char *pSQL,PRESTORE pRestore);
	bool UpdateRestore(char *pSQL,PRESTORE pRestore);
	bool DeleteRestore(char *pSQL,PRESTORE pRestore);

	bool WriteCacheFile(char *pSQL,PRESTORE pRestore);
	bool WritePlayUrl(char *pSQL,char *pUrl);

	bool HitRec(char *pSQL,char *pFileName,char *pClient,int nHitSize);
	bool DeleteUCFile();
	bool FlowCount(char *pSQL,PFLOWCOUNT pFlowCount);

	bool UpdateVisit(char *pSQL,char *pHost);

	bool ReadVerifyInfo(PVERIFY pVerify);
	bool UpdateUserInfo(PUSERINFO pUserInfo);
	bool UpdateSysInfo(char *pLibVer);

	bool ReadCacheFile(PSENDCACHEFILE pCacheFile,char *pUserCode,int &nRecordCount,unsigned int &nMaxID);
	bool UpdateCacheFile(int nMaxID);

	bool ClearDisk(char *pDisk,unsigned long ulDiskMinSpace);
	bool GetDisks(char *pDisks);

	bool UpdateDisk(char *pDisk,int nTotalSize,int nRemainSize,char *pTag);
	void GetTag(char *pTag);
	bool DeleteDisk(char *pTag);

	bool DeleteWebSite(char *pTag);

	bool ExecSQL(char *pSQL);
};
#endif